{% extends('layout.html') %}
{% block body %}
<!-- slider (good UX however kind of pointless if you don't have anything to display that's really neat? -->
{% if hasSlider %}
{% include('slider.html') %}
{% endif %}
<section id="dropdown" class="section">
    <div class="container">
        <div class="col s12 m12">
            <div class="card-panel">
                <h4 class="red-text">System Services</h4>
                <table class="striped center">
                    <thead>
                        <tr>
                            <th>Service Name</th>
                            <th>Description</th>
                            <th>Status</th>
                            <th>Control</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for name, description, status in service_info %}
                        <tr>
                            <td><h6>{{name}}</h6></td>
                            <td>{{description}}</td>
                            <td>
                                {% if status %}
                                <h6 class="green-text">Up</h6>
                                {% else %}
                                <h6 class="red-text">Down</h6>
                                {% endif %}
                            </td>
                            <td>
                                <div class="row">
                                    <div class="input-field col s3 m3 l2">
                                        <form action="/system/services" method="POST">
                                            <input type="hidden" name="start_svc" value="{{name}}">
                                            <button class="btn waves-effect waves-light col s12">
                                                <i class="material-icons">play_arrow</i>
                                            </button>
                                        </form>
                                    </div>
                                    <div class="input-field col s3 m3 l2">
                                        <form action="/system/services" method="POST">
                                            <input type="hidden" name="restart_svc" value="{{name}}">
                                            <button class="btn waves-effect waves-light col s12">
                                                <i class="material-icons">autorenew</i>
                                            </button>
                                        </form>
                                    </div>
                                    <div class="input-field col s3 m3 l2">
                                        <form action="/system/services" method="POST">
                                            <input type="hidden" name="stop_svc" value="{{name}}">
                                            <button class="btn waves-effect waves-light col s12">
                                                <i class="material-icons">stop</i>
                                            </button>
                                        </form>
                                    </div>
                                </div>
                            </td>
                        </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</section>
{% endblock %}